home *** CD-ROM | disk | FTP | other *** search
- /**
- ** CHKEVGA.C ---- code fragment to check for EGA or VGA
- **
- ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
- ** Copyright (C) 1992 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
- ** Copyright (C) 1993 Grzegorz Mazur, gbm@ii.pw.edu.pl
- **
- ** This file is distributed under the terms listed in the document
- ** "copying.dj", available from DJ Delorie at the address above.
- ** A copy of "copying.dj" should accompany this file; if not, a copy
- ** should be available from where this file was obtained. This file
- ** may not be distributed without a verbatim copy of "copying.dj".
- **
- ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
- ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- **/
-
- int check_for_EGAVGA(void)
- {
- /* check for EGA/VGA by trying to get pointer to 8x14 ROM BIOS font */
- asm push bp;
- _BP = 0xffff;
- _ES = _BP;
- _AX = 0x1130;
- _BX = 0x0200;
- _CX = 0;
- geninterrupt(0x10);
- _AX = _ES;
- _DX = _BP;
- asm pop bp;
- return(((_AX != 0xffff) && (_DX != 0xffff) && (_CX >= 14) && (_CX <= 16)) ? 1 : 0);
- }
-